<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fc.util.*" %>
<%@ page import="com.fc.model.Worker" %>
<%@ page import="com.fc.control.WorkerControl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>worker_add_do</title>
</head>
<body>
<%
      request.setCharacterEncoding("UTF-8");
      String position = ParamUtil.getString(request,"position");   
      String addtime = ParamUtil.getString(request,"addtime");
      String idcard = ParamUtil.getString(request,"idcard");
      String name = ParamUtil.getString(request,"name");
  	  int store_id =  ParamUtil.getInt(request,"store_id");
  	  int wages =  ParamUtil.getInt(request,"wages");
  	  
  	  WorkerControl wc = new  WorkerControl();
      Worker worker = new Worker();
      worker.setPosition(position);
	  worker.setAddtime(addtime);
	  worker.setIdcard(idcard);
	  worker.setName(name);
	  worker.setStore_id(store_id);
	  worker.setWages(wages);
        if(wc.addWorker(worker))
  			{
  				%>
		<script language="javascript">
				if(window.confirm("添加成功，是否继续?"))
				window.location.href="worker_add.jsp";
				else
  				window.location.href="worker.jsp";
  				</script>
		<%} else { %>
		<script language="javascript">
  				if(window.confirm("添加失败，是否重新添加?"))
				window.location.href="worker_add.jsp";
				else
				window.location.href="worker.jsp";
  		</script>
		<%} 
   %>
</body>
</html>